/*
 * Copyright 2010 Katsunori Koyanagi
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package sweezy.anim.core
{
	import flash.events.IEventDispatcher;

	[Event(type="sweezy.anim.core.AnimationEvent", name="animationComplete")]
	[Event(type="sweezy.anim.core.AnimationEvent", name="animationUpdate")]
	[Event(type="sweezy.anim.core.AnimationEvent", name="animationPause")]
	[Event(type="sweezy.anim.core.AnimationEvent", name="animationStart")]
	public interface IAnimation extends IEventDispatcher
	{
		///////////////////////////////////////////////////
		//TODO
		//DEEPでも関数や関数パラメータのインスタンスまではDEEP COPYしない
		//課題（addEventListenerはどうする？)
		//function clone(deep:Boolean = false):IAnimation;
		///////////////////////////////////////////////////
		//TODO
		//既に破棄済みの場合はなにもしないが、再帰フラグが立っている場合は子要素に対しては行う
		//課題（removeEventListenerはどうする？)
		//アニメーション中の場合は即座に停止を行う
		//function destroy(recursive:Boolean = false):void;
		///////////////////////////////////////////////////
		//TODO
		//破棄済みであるか
		//statusFlagsの未使用領域を使用して保持
		//function get destroyed():Boolean;
		///////////////////////////////////////////////////
		//TODO
		//破棄済みの場合にstart/pauseなどの基本動作は全て無視する
		//positionが設定されていてもなにもしない 
		//Eventsクラスの参照方法をより遅延させる(function get eventsは削除)
		//Eventsクラスにリスナの管理を行わせる
		///////////////////////////////////////////////////

		function get autoRewind():Boolean;

		function set autoRewind(value:Boolean):void;

		function get data():Object;

		function set data(value:Object):void;

		function get duration():uint;

		function gotoAndStart(position:int):IAnimation;

		function gotoAndStop(position:int):IAnimation;

		function initialize():void;

		function get initialized():Boolean;

		function get onComplete():Function;

		function set onComplete(value:Function):void;

		function get onCompleteParams():Array;

		function set onCompleteParams(value:Array):void;

		function get onCompleteScope():Object;

		function set onCompleteScope(value:Object):void;

		function get onPause():Function;

		function set onPause(value:Function):void;

		function get onPauseParams():Array;

		function set onPauseParams(value:Array):void;

		function get onPauseScope():Object;

		function set onPauseScope(value:Object):void;

		function get onStart():Function;

		function set onStart(value:Function):void;

		function get onStartParams():Array;

		function set onStartParams(value:Array):void;

		function get onStartScope():Object;

		function set onStartScope(value:Object):void;

		function get onUpdate():Function;

		function set onUpdate(value:Function):void;

		function get onUpdateParams():Array;

		function set onUpdateParams(value:Array):void;

		function get onUpdateScope():Object;

		function set onUpdateScope(value:Object):void;

		function get parameters():Object;

		function pause():IAnimation;

		function get playing():Boolean;

		function get position():int;

		function set position(value:int):void;

		function restart():IAnimation;

		function start(name:String = null):IAnimation;

		function stop():IAnimation;

		function update():IAnimation;
	}
}
